﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HokjesSluitenBot
{
    public class StreamManager
    {
        protected static StreamReader instrm = new StreamReader(Console.OpenStandardInput());
        protected static StreamWriter outstrm = new StreamWriter(Console.OpenStandardOutput());

        public void writeStream(string line)
        {
            outstrm.WriteLine(line);
            outstrm.Flush();
        }

        public string readStream()
        {
            string readLine = string.Empty;
            while ((readLine = instrm.ReadLine()) != null)
            {
                instrm.DiscardBufferedData();
                return readLine;
            }
            return readLine;
        }
    }
}
